home *** CD-ROM | disk | FTP | other *** search
- --------------------------------------------------------------------------------
- -- Weapon End Turn
- -- Original Carnage Contest Weapon
- -- Script by DC, September 2009, www.UnrealSoftware.de
- --------------------------------------------------------------------------------
-
- -- Setup Tables
- if cc==nil then cc={} end
- cc.endturn={}
-
- -- Load & Prepare Ressources
- cc.endturn.gfx_wpn=loadgfx("weapons/endturn.png") -- Weapon Image
- setmidhandle(cc.endturn.gfx_wpn)
- cc.endturn.sfx_attack=loadsfx("boing.ogg")
-
-
- --------------------------------------------------------------------------------
- -- Weapon: End Turn
- --------------------------------------------------------------------------------
-
- cc.endturn.id=addweapon("cc.endturn","End Turn",cc.endturn.gfx_wpn) -- Add Weapon
-
- function cc.endturn.draw() -- Draw
- if (weapon_shots<=0) then
- setblend(blend_alpha)
- setalpha(1)
- setcolor(255,255,255)
- setscale(0.5+math.abs(math.sin(math.rad(weapon_charge)))*0.5,0.5+math.cos(math.sin(math.rad(weapon_charge)))*0.5)
- drawimage(cc.endturn.gfx_wpn,getplayerx(0),getplayery(0)-30)
- -- Animation
- weapon_charge=weapon_charge+5
- if weapon_charge>=360 then weapon_charge=0 end
- -- HUD Info
- hudinfo("Press [Space] to end the turn!")
- end
- end
-
- function cc.endturn.attack(attack) -- Attack
- if (weapon_shots<=0) then
- if (attack==1) then
- -- No more weapon switching!
- useweapon(0)
- weapon_shots=weapon_shots+1
- -- SFX
- playsound(cc.endturn.sfx_attack)
- -- End Turn
- endturn()
- end
- end
- end